package drds.common.db.xml_mapping.executor;


import drds.common.db.xml_mapping.mapping.BindSql;
import drds.common.db.xml_mapping.mapping.Mapper;
import drds.common.db.xml_mapping.session.ResultHandler;
import drds.common.db.xml_mapping.session.RowBounds;
import drds.common.db.xml_mapping.transaction.Transaction;

import java.sql.SQLException;
import java.util.List;

public interface Executor {

  ResultHandler NO_RESULT_HANDLER = null;

  int update(Mapper mapper, Object parameter) throws SQLException;

  <E> List<E> query(Mapper mapper, Object parameter, RowBounds rowBounds, ResultHandler resultHandler, BindSql bindSql) throws SQLException;

  <E> List<E> query(Mapper mapper, Object parameter, RowBounds rowBounds, ResultHandler resultHandler) throws SQLException;


  List<BatchResult> flushStatements() throws SQLException;

  void commit(boolean required) throws SQLException;

  void rollback(boolean required) throws SQLException;


  Transaction getTransaction();

  void close(boolean forceRollback);

  boolean isClosed();


}
